\(\int \frac {\cot (c+d x)}{a+b \sin ^2(c+d x)} \, dx\) [445]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 38 \[ \int \frac {\cot (c+d x)}{a+b \sin ^2(c+d x)} \, dx=\frac {\log (\sin (c+d x))}{a d}-\frac {\log \left (a+b \sin ^2(c+d x)\right )}{2 a d} \]

[Out]

ln(sin(d*x+c))/a/d-1/2*ln(a+b*sin(d*x+c)^2)/a/d

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3273, 36, 29, 31} \[ \int \frac {\cot (c+d x)}{a+b \sin ^2(c+d x)} \, dx=\frac {\log (\sin (c+d x))}{a d}-\frac {\log \left (a+b \sin ^2(c+d x)\right )}{2 a d} \]

[In]

Int[Cot[c + d*x]/(a + b*Sin[c + d*x]^2),x]

[Out]

Log[Sin[c + d*x]]/(a*d) - Log[a + b*Sin[c + d*x]^2]/(2*a*d)

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 3273

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = Free
Factors[Sin[e + f*x]^2, x]}, Dist[ff^((m + 1)/2)/(2*f), Subst[Int[x^((m - 1)/2)*((a + b*ff*x)^p/(1 - ff*x)^((m
 + 1)/2)), x], x, Sin[e + f*x]^2/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {1}{x (a+b x)} \, dx,x,\sin ^2(c+d x)\right )}{2 d} \\ & = \frac {\text {Subst}\left (\int \frac {1}{x} \, dx,x,\sin ^2(c+d x)\right )}{2 a d}-\frac {b \text {Subst}\left (\int \frac {1}{a+b x} \, dx,x,\sin ^2(c+d x)\right )}{2 a d} \\ & = \frac {\log (\sin (c+d x))}{a d}-\frac {\log \left (a+b \sin ^2(c+d x)\right )}{2 a d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.00 \[ \int \frac {\cot (c+d x)}{a+b \sin ^2(c+d x)} \, dx=\frac {\log (\sin (c+d x))}{a d}-\frac {\log \left (a+b \sin ^2(c+d x)\right )}{2 a d} \]

[In]

Integrate[Cot[c + d*x]/(a + b*Sin[c + d*x]^2),x]

[Out]

Log[Sin[c + d*x]]/(a*d) - Log[a + b*Sin[c + d*x]^2]/(2*a*d)

Maple [A] (verified)

Time = 0.96 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.42

method result size
derivativedivides \(\frac {-\frac {\ln \left (a +b -b \left (\cos ^{2}\left (d x +c \right )\right )\right )}{2 a}+\frac {\ln \left (1+\cos \left (d x +c \right )\right )}{2 a}+\frac {\ln \left (\cos \left (d x +c \right )-1\right )}{2 a}}{d}\) \(54\)
default \(\frac {-\frac {\ln \left (a +b -b \left (\cos ^{2}\left (d x +c \right )\right )\right )}{2 a}+\frac {\ln \left (1+\cos \left (d x +c \right )\right )}{2 a}+\frac {\ln \left (\cos \left (d x +c \right )-1\right )}{2 a}}{d}\) \(54\)
risch \(\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d a}-\frac {\ln \left ({\mathrm e}^{4 i \left (d x +c \right )}-\frac {2 \left (2 a +b \right ) {\mathrm e}^{2 i \left (d x +c \right )}}{b}+1\right )}{2 a d}\) \(60\)

[In]

int(cot(d*x+c)/(a+b*sin(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/2/a*ln(a+b-b*cos(d*x+c)^2)+1/2/a*ln(1+cos(d*x+c))+1/2/a*ln(cos(d*x+c)-1))

Fricas [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.92 \[ \int \frac {\cot (c+d x)}{a+b \sin ^2(c+d x)} \, dx=-\frac {\log \left (-b \cos \left (d x + c\right )^{2} + a + b\right ) - 2 \, \log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right )}{2 \, a d} \]

[In]

integrate(cot(d*x+c)/(a+b*sin(d*x+c)^2),x, algorithm="fricas")

[Out]

-1/2*(log(-b*cos(d*x + c)^2 + a + b) - 2*log(1/2*sin(d*x + c)))/(a*d)

Sympy [F]

\[ \int \frac {\cot (c+d x)}{a+b \sin ^2(c+d x)} \, dx=\int \frac {\cot {\left (c + d x \right )}}{a + b \sin ^{2}{\left (c + d x \right )}}\, dx \]

[In]

integrate(cot(d*x+c)/(a+b*sin(d*x+c)**2),x)

[Out]

Integral(cot(c + d*x)/(a + b*sin(c + d*x)**2), x)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.97 \[ \int \frac {\cot (c+d x)}{a+b \sin ^2(c+d x)} \, dx=-\frac {\frac {\log \left (b \sin \left (d x + c\right )^{2} + a\right )}{a} - \frac {\log \left (\sin \left (d x + c\right )^{2}\right )}{a}}{2 \, d} \]

[In]

integrate(cot(d*x+c)/(a+b*sin(d*x+c)^2),x, algorithm="maxima")

[Out]

-1/2*(log(b*sin(d*x + c)^2 + a)/a - log(sin(d*x + c)^2)/a)/d

Giac [A] (verification not implemented)

none

Time = 0.66 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.00 \[ \int \frac {\cot (c+d x)}{a+b \sin ^2(c+d x)} \, dx=\frac {\frac {\log \left (\sin \left (d x + c\right )^{2}\right )}{a} - \frac {\log \left ({\left | b \sin \left (d x + c\right )^{2} + a \right |}\right )}{a}}{2 \, d} \]

[In]

integrate(cot(d*x+c)/(a+b*sin(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*(log(sin(d*x + c)^2)/a - log(abs(b*sin(d*x + c)^2 + a))/a)/d

Mupad [B] (verification not implemented)

Time = 13.60 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.08 \[ \int \frac {\cot (c+d x)}{a+b \sin ^2(c+d x)} \, dx=-\frac {\ln \left (a+a\,{\mathrm {tan}\left (c+d\,x\right )}^2+b\,{\mathrm {tan}\left (c+d\,x\right )}^2\right )-2\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{2\,a\,d} \]

[In]

int(cot(c + d*x)/(a + b*sin(c + d*x)^2),x)

[Out]

-(log(a + a*tan(c + d*x)^2 + b*tan(c + d*x)^2) - 2*log(tan(c + d*x)))/(2*a*d)